package com.atguigu.springcloud.service.impl;

import com.atguigu.springcloud.dao.PaymentDao;
import com.atguigu.springcloud.entities.Payment;
import com.atguigu.springcloud.service.PaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author 赵雨强
 * @create 2021/4/30 6:41
 */
@Service
public class PaymentServiceImpl implements PaymentService {

    //@Autowired
    @Resource
    private PaymentDao paymentDao;

    /**
     * 向数据库写
     * @param payment 写入的订单
     * @return 是否成功
     */
    @Override
    public int create(Payment payment) {
        return paymentDao.create(payment);
    }

    /**
     * 根据ID查询
     * @param id ID
     * @return 订单完整信息
     */
    @Override
    public Payment getPaymentById(Long id) {
        return paymentDao.getPaymentById(id);
    }
}
